package de.tum.in.far.threedui.general;

import javax.media.j3d.BoundingBox;
import javax.media.j3d.BranchGroup;
import javax.media.j3d.Transform3D;
import javax.media.j3d.TransformGroup;
import javax.vecmath.Vector3f;


public class ModelObject extends TransformableObject {
	
	public ModelObject(BranchGroup model) {
		this.setCapability(ALLOW_CHILDREN_EXTEND);
		this.setCapability(ALLOW_CHILDREN_READ);
		this.setCapability(ALLOW_CHILDREN_WRITE);
		this.setCapability(ALLOW_DETACH);
		
		Transform3D rotationT3D = new Transform3D();
		rotationT3D.rotX(Math.PI / 2);
		Transform3D translationT3D= new Transform3D();
		translationT3D.setTranslation(new Vector3f(0, 0, 0.01f));
		
		translationT3D.mul(rotationT3D);
		TransformGroup tg = new TransformGroup(translationT3D);
		tg.addChild(model);
		super.transGroup.addChild(tg);
	}
	
}
